package Pantallas;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.container.GridFieldManager;
import net.rim.device.api.ui.decor.BackgroundFactory;
import net.rim.device.api.ui.decor.Border;
import net.rim.device.api.ui.decor.BorderFactory;
import GUI.BitmapButtonField;
import GUI.ShortcutHandler;
import Main.MyApp;
/**
 * A class extending the MainScreen class, which provides default standard
 * behavior for BlackBerry GUI applications.
 */
/**
 * 
 * @author ARMGARCES
 */
public final class PantallaSesionIniciada extends Pantalla
{	
	private int width;
	private int height;
	//private static Usuario user;
    /**
     * Creates a new MyScreen object
     */
    public PantallaSesionIniciada(){        
    	super();
    	this.addKeyListener (new ShortcutHandler());
        width  = MyApp.getWidth();
        height = MyApp.getHeight();
    	Bitmap bitmap = Bitmap.getBitmapResource("r1.png");
    	
        BitmapButtonField b  = new BitmapButtonField(bitmap, bitmap,0);
        BitmapButtonField b1 = new BitmapButtonField(bitmap, bitmap,1);
        BitmapButtonField b2 = new BitmapButtonField(bitmap, bitmap,2);
        BitmapButtonField b3 = new BitmapButtonField(bitmap, bitmap,3);

        // Set up the 
		GridFieldManager gfm1 = new GridFieldManager(2, 2, GridFieldManager.FIXED_SIZE);
		gfm1.setColumnPadding(1);
	
		gfm1.setBorder(BorderFactory.createSimpleBorder( new XYEdges(0, 0, 0, 0),  Border.STYLE_DASHED)); 
		 
		// Size the columns of the GridFieldManager. Make sure to calculate 
		// for the padding applied to the columns. 
		int columnWidth = (width / 2) - gfm1.getColumnPadding();
		
		int rowHeight   = (height / 2) - gfm1.getColumnPadding() - 15;
		
		for(int i = 0; i < 2; i++) {
			gfm1.setColumnProperty(i, GridFieldManager.FIXED_SIZE, columnWidth);
			gfm1.setRowProperty(i, GridFieldManager.FIXED_SIZE, rowHeight);
		} 
		// Populate the columns. 
		gfm1.add(b); 
		gfm1.add(b1); 
		gfm1.add(b2); 
		gfm1.add(b3);
		gfm1.setBackground(BackgroundFactory.createBitmapBackground(Bitmap.getBitmapResource("i3.jpg")));
		add(gfm1);
    }
   
}